/*
 * RFM12RingBuffer.h
 *
 *  Created on: 25.07.2011
 *      Author: Stefan Haller
 */

#ifndef RFM12RINGBUFFER_H_
#define RFM12RINGBUFFER_H_

#include "RFM12_hw.h"

#define RFM12_RINGBUFFER_BUFFER_SIZE 		0x80
#define RFM12_RINGBUFFER_POINTER_MASK		RFM12_RINGBUFFER_BUFFER_SIZE-1
#define RFM12_RINGBUFFER_SEG 				RFM12_RINGBUFFER_BUFFER_SIZE

struct {
volatile uint8_t Status;

volatile uint8_t RX_Buffer[RFM12_RINGBUFFER_BUFFER_SIZE];
volatile uint8_t RX_BufferReadPointer;
volatile uint8_t RX_BufferReceivePointer;

} RFM12_RingBuffer_Data;

void RFM12_RingBuffer_init(void);
uint8_t RFM12_RingBuffer_newDataArrived(void);
uint8_t RFM12_RingBuffer_readDataByte(void);
uint8_t RFM12_RingBuffer_addData(uint8_t dataToAdd);

#endif /* RFM12RINGBUFFER_H_ */
